// 手机号格式校验
const phoneFalg = (str) => {
  if (str.length == 11 && /^[1][2,3,4,5,6,7,8,9][0-9]{9}$/.test(str)) {
    return true;
  } else {
    return false;
  }
};
const request = (params) => {
  return new Promise((resolve, reject) => {
    uni.request({
      ...params,
      dataType: 'json',
      timeout: 8*1000,
      success: (result) => {
        resolve(result)
      },
      fail: (err) => {
        uni.showToast({
          icon: 'none',
          title: '网络连接错误，稍后再试！'
        })
        resolve('');
      },
      complete: () => {}
    });
  });	
};
export {
	phoneFalg,
	request
}


